<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Homework extends User_Controller {

	public function __construct()
    {
        parent::__construct();
        // Your own constructor code
        $this->smarty->assign("current_class", $this->router->fetch_class());
        $this->smarty->assign("current_method",$this->router->fetch_method());
		$this->uid = $this->user_data['id'];
		if( $this->logged_in==0) {header("Location:/");exit;}
    }


	public function homework()
	{
		//获取作业
		$this->load->model('User_center_model');
		$homework = $this->User_center_model->get_homework_by_uid($this->user_data['id']);
		$this->smarty->assign("homework", $homework);
		$this->smarty->assign("menu", "homework");
		$this->smarty->display("user/homework.html");
	}

}